Method for generating a non-graphical digital image from an original digital image

ABSTRACT

A method for generating a non-graphical digital image from an original digital image includes the following steps: performing edge detection to generate a third digital image, performing screen dot detection to detect the photo regions in the original digital image, detecting color regions in the original digital image, removing the photo regions and the color regions from the third digital image to generate the non-graphical digital image.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to a method for categorizing contents of adigital image, especially a method for generating a non-graphicaldigital image from an original digital image.

2. Description of the Prior Art

In the field of image processing, it is becoming increasingly common tochoose a digital means of image capture and storage over moreconventional means. One of the advantages of digital image storage isthe ease for users to edit images. In other words, a digital image canbe easily edited, enhanced, or copied through digital image processing.This means that new levels of simplicity and flexibility have beenintroduced to users in a digital image-editing environment, andaccordingly, many techniques are developed and improved to add values infunctionality of digital image processing.

In digital image processing, if a page needs to be captured into adigital file by an image-capturing device, such as a digital camera or ascanner, the photo on that page will be processed through a screeningtechnique to change continuous tones into limited tone levels, such asthe commonly-used halftone technique, and the other parts of the pagesuch as lines, text and graphics will be transformed into solid spot. Ascreen dot is different from a pixel, used to form a photo image on aprinted matter, and the size of the screen dot is proportional to toneresponse of pixels. Sometimes the size of a screen dot is equal to thatof a plurality of pixels. The photo is screened while printing, and thescreened results of each color are overlapped to form a structure ofrosette and moiré. In this way, the tones of an output halftone image onthe printed page can be seen equally to the continuous tones of theoriginal photo image.

Please refer to FIG. 1. FIG. 1 shows a printed page 10 generated throughdigital image processing according to the prior art. The printed page 10includes a photo 11, graphics 12, and text 13. The printed page 10 isprinted according to an original page after scanned by a scanner;therefore, according to the abovementioned technique, the photo 11 ofthe printed page 10 is rich in moiré formed by screen dots. The graphics12 in the printed page 10 include color marks, and graphics. The text 13in the printed page 10 is written in neutral color (withoutchrominance). Please note that the definition of a graphical region hereincludes photos and graphics, photos in the printed page are formed byscreen dots, and graphics are defined as marks, or artificially addedarticles with uniform and bright colors. Text includes word-lines ormarks with a high luminance contrast to the background region butwithout any chrominance. That is “text” only means text written inneutral color, however, color text is treated as a graphic. According tothe conventional technique, edges with a high luminance contrast to thebackground, including all the word-lines, are detected by an edgedetection method. An edge is defined as a border between two sideshaving a luminance contrast above a luminance threshold. Theconventional edge detection method utilizes an operator, given asfollows, or a mask to detect whether there is an edge in a predeterminedregion or not:

$\quad\begin{bmatrix}{- 1} & 0 & 1 \\{- 1} & 0 & 1 \\{- 1} & 0 & 1\end{bmatrix}$

From this operator, we can see the (1,1) entry is −1, and the (3,1)entry is 1, which means the operator is subtracting the luminance of theleft pixel from the luminance of the right pixel. Hence, one operatorcan only detect the luminance difference in one direction, and manyoperators should be applied when detecting each direction. Therefore, alot of resources are needed and operating cost is increased accordingly.Moreover, the conventional edge detection method detects luminance ofthe whole printed page, including regions of middle luminance, whichshould not belong to the text. Please refer to FIG. 2 for an example.FIG. 2 is a drawing of the detected results including text and undesirededges according to the conventional edge detection method.

If a user wants to edit the printed page 10, for example performing anenhancement in the text 13 of the printed page 10, most methods ofdigital image processing according to the prior art adjust the wholeimage in the printed page 10 so as to get the stress effect of the text13. But this makes the other parts in the printed page 10, such asgraphics, which do not need enhancement, also be enhanced. This oftencreates some unexpected defects and unwanted results in exhibition ofthe whole image.

SUMMARY OF THE INVENTION

The embodiment of the present invention releases a method for generatinga non-graphical digital image from an original digital image, comprisingfollowing steps: detecting first areas of the original digital imagewhose luminance values are above a first predetermined luminancethreshold; detecting second areas of the original digital image whoseluminance values are below a second predetermined luminance threshold,the second predetermined luminance threshold being smaller than thefirst predetermined luminance threshold; dilating the first areas togenerate a first digital image; dilating the second areas to generate asecond digital image; generating a third digital image including edgesfrom dilated first and second areas; performing screen dot detection inthe original digital image for detecting photo regions; detecting colorregions in the original digital image; and removing the photo regionsand the color regions from the third digital image to generate thenon-graphical digital image.

Another embodiment of present invention further releases a method forgenerating a non-graphical digital image from an original digital image,comprising following steps: performing edge detection in the originaldigital image to generate a third digital image comprising edges betweenfirst areas whose luminance values are above a first predeterminedluminance threshold and second areas whose luminance values are below asecond predetermined luminance threshold; performing screen dotdetection in the original digital image for detecting photo regions;detecting color regions in the original digital image; and removingscreen blocks detected in the seventh digital image and the colorregions from the third digital image to generate the non-graphicaldigital image. Performing screen dot detection in the original digitalimage for detecting photo regions comprises: analyzing a number of linesper inch in a predetermined coordinate region in the original digitalimage by performing Discrete Fourier Transform to determine if thepredetermined coordinate region is a screen block; generating a fourthdigital image comprising a plurality of screen blocks according toanalyzed results; generating a fifth digital image by setting blocksbetween two screen blocks which match a predetermined pattern and are ofa same dimension as screen blocks; and generating a sixth digital image;generating a seventh digital image by setting a block as a screen blockwithin a fourth set of blocks when there is at least one screen blockbesides the block within the fourth set of blocks. Generating a sixthdigital image is performed by: setting a left-most and top-most block inthe fifth digital image as a screen block or a non-screen blockaccording to a number of screen blocks besides the left-most andtop-most block within a first set of blocks in the fifth digital image,and generating the sixth digital image; and setting a block in a secondset of blocks in the sixth digital image as a screen block or anon-screen block according to a number of screen blocks besides theblock within the second set of blocks in the sixth digital image, and anumber of screen blocks besides the block within a third set of blocksin the fifth digital image, and updating the sixth digital image, theblock being a center block of the third set of blocks.

Another embodiment of the present invention further releases a methodfor generating a non-graphical digital image from an original digitalimage, comprising the following steps: performing edge detection in theoriginal digital image to generate a third digital image comprisingedges between first areas whose luminance values are above a firstpredetermined luminance threshold and second areas whose luminancevalues are below a second predetermined luminance threshold; performingscreen dot detection in the original digital image for detecting photoregions; detecting color regions in the original digital image; andremoving screen blocks detected in the seventh digital image and thecolor regions from the third digital image to generate the non-graphicaldigital image. Performing screen dot detection in the original digitalimage for detecting photo regions comprises generating a eighth digitalimage by setting a center pixel of a first block of pixels as a screendot according to luminance differences between the center pixel andneighboring pixels chosen according to a predetermined rule within thefirst block; generating a ninth digital image by setting a second blockof pixels as a screen block when there is at least one screen dot withinthe second block; generating a fifth digital image by setting blocksbetween two screen blocks, which match a predetermined pattern and areof a same dimension as screen blocks; generating a sixth digital image;and generating a seventh digital image by setting a block as a screenblock within a fourth set of blocks when there is at least one screenblock besides the block within the fourth set of blocks. Generating asixth digital image is performed by: setting a left-most and top-mostblock in the fifth digital image as a screen block or a non-screen blockaccording to a number of screen blocks besides the left-most andtop-most block within a first set of blocks in the second digital image,and generating the sixth digital image; and setting a block in a secondset of blocks in the sixth digital image as a screen block or anon-screen block according to a number of screen blocks besides theblock within the second set of blocks in the sixth digital image, and anumber of screen blocks besides the block within a third set of blocksin the fifth digital image, and updating the sixth digital image, theblock being a center block of the third set of blocks.

These and other objectives of the present invention will no doubt becomeobvious to those of ordinary skill in the art after reading thefollowing detailed description of the preferred embodiment that isillustrated in the various figures and drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 shows a printed page generated through a digital image processingaccording to the prior art.

FIG. 2 is a drawing of the detection result according to theconventional edge detection method.

FIG. 3 is an original printed page.

FIG. 4 is the overall flowchart of the method according to an embodimentof the present invention.

FIG. 5 is a more detailed flow chart of step 100 in FIG. 4.

FIG. 6 is a drawing of the detected results according to steps 101 and103 in FIG. 5.

FIG. 7 is the first regions detected in FIG. 3.

FIG. 8 is the second regions detected in FIG. 3.

FIG. 9 is a first digital image including the dilation result of FIG. 7.

FIG. 10 is a second digital image including the dilation result of FIG.8.

FIG. 11 is a third digital image including the intersection edges ofFIG. 9 and FIG. 10.

FIG. 12 is the intersection edges according to FIG. 6.

FIG. 13-20 are the normalized spectrum images of uniform patches ofmonochrome photos of 200 lpi.

FIG. 21-24 are the spectrum images of multipass-color photos (with moiréstructure) of 200 lpi.

FIG. 25 is the flow chart of utilizing Discrete Fourier Transform tocomplete the screen dot detection.

FIG. 26 is a fourth digital image of the result of screen dot detectionaccording to FIG. 3 as derived from Discrete Fourier Transform.

FIG. 27 is the detailed flowchart of the peak-block-connection step.

FIG. 28 is a drawing of a predetermined line pattern stored in thestorage device of the executing system.

FIG. 29 includes drawings of peak blocks A and B, and region C, anddrawings of line patterns in peak blocks A and B, and the convertedresult in region C according to the first embodiment of the presentinvention.

FIG. 30 is a fifth digital image of the result derived from thepeak-block-connection step according to FIG. 3.

FIG. 31 and FIG. 32 are the detailed flowcharts of removing blockschosen incorrectly according to the first embodiment of the presentinvention.

FIG. 33 is a drawing of Condition III of removing the blocks chosenincorrectly.

FIG. 34 is a drawing of Condition IV of removing the blocks chosenincorrectly.

FIG. 35 is a sixth digital image of the result of removing the blockschosen incorrectly according to FIG. 3.

FIG. 36 is the detailed flowchart of expanding the detected region ofthe photo according to the first embodiment of the present invention.

FIG. 37 includes a drawing of a block in a detected region including ascreen block and a drawing of outputting the block as a screen block.

FIG. 38 is a seventh digital image of the result of expanding thedetected region of the photo according to FIG. 3.

FIG. 39 is the detailed flowchart of peak/valley detection according tothe second embodiment of the present invention.

FIG. 40 is an exemplary drawing of choosing neighboring pixels when thenumber of lines per inch is less according to the second embodiment ofthe present invention.

FIG. 41 is an exemplary drawing of choosing neighboring pixels when thenumber of lines per inch is greater according to the second embodimentof the present invention.

FIG. 42 is the detailed flowchart of integrating the detected screendots according to the second embodiment of the present invention.

FIG. 43 is a drawing of the procedures of integrating the detectedscreen dots according to the second embodiment of the present invention.

FIG. 44 is a drawing of the result of edge detection according to FIG.3.

FIG. 45 is a drawing of the result of screen dot detection according toFIG. 3.

FIG. 46 is a drawing of the result of removing the photo detected by thescreen dot detection from the third digital image generated from theedge detection step according to FIG. 44 and FIG. 45.

FIG. 47 is a drawing of the chrominance distribution according to CaCbdata; wherein the center white region of FIG. 47 is the region ofneutral color.

FIG. 48 is a drawing of the region of detected edges including text andcolor lines after performing steps 100, 200, 300 on FIG. 4.

FIG. 49 is a non-graphical digital image generated after removing thedetected color regions from the third digital image according to FIG. 3and FIG. 48.

DETAILED DESCRIPTION

The present invention discloses a method for generating a non-graphicaldigital image from an original digital image of a printed page to avoidthe abovementioned defects in the prior art. Please refer to FIG. 3.FIG. 3 shows an original digital image of a printed page. FIG. 3includes a printed page 20 containing a photo 27, and text 23. Thepresent invention utilizes the luminance of a digital image tocategorize the graphical regions, such as the photo 27, andnon-graphical regions, such as the text 23, in the printed page 20.Therefore, first, a transformation from RGB to YCaCb should be performedon the pixels. The transformation matrix is listed below:

$\begin{bmatrix}Y \\{Ca} \\{Cb}\end{bmatrix} = {\begin{bmatrix}{M\; 11} & {M\; 12} & {M\; 13} \\{M\; 21} & {M\; 22} & {M\; 23} \\{M\; 31} & {M\; 32} & {M\; 33}\end{bmatrix}\begin{bmatrix}R \\G \\B\end{bmatrix}}$

Through a 3*3 transformation matrix, the mixed luminance and chrominancecomponents in RGB pixels are separated into YCaCb components, whereinthe luminance component is Y, and the chrominance components are Ca andCb.

Please refer to FIG. 4. FIG. 4 is the overall flowchart of the methodaccording to the present invention. The main steps of the method arelisted below:

Step 100: perform edge detection to detect all edges between first areaswhose luminance values are above a first predetermined luminancethreshold and second areas whose luminance values are below a secondpredetermined luminance threshold in the original digital image of theprinted page 20.

Step 200: perform screen dot detection in the original digital image ofthe printed page 20 for detecting a photo region 27.

Step 300: remove the detected edges in the detected photo region 27 fromthe original digital image of the printed page 20.

Step 400: detect color regions in the original digital image of theprinted page 20.

Step 500: remove the detected edges in the detected color regions fromthe original digital image of the printed page 20.

Step 600: generate a non-graphical digital image from the regionssurrounded by the remaining detected edges.

Detailed description of the above procedures is introduced as follows.First, the edge detection is performed to detect all the edges betweenfirst areas whose luminance values are above a first predeterminedluminance threshold and second areas whose luminance values are below asecond predetermined luminance threshold in the original digital imagegenerated from the printed page 20. The first and second predeterminedluminance thresholds are mainly decided according to the characteristicsof the original digital image of the printed page 20, such as thedifference between the maximum and the minimum luminance of the originaldigital image of the printed page 20. The edges derived from this stepwill contain more than the edges of the text 23. Next, perform screendot detection in the original digital image for detecting the region ofthe photo 27. As aforementioned, a photo generated from animage-capturing device is rich in moiré formed by screen dots, thereforedetecting the region(s) formed by screen dots can determine where thephoto region 27 is in the printed page 20 correctly. Subsequently,remove the detected edges in step 100 in the detected photo region(s)from the original digital image. Then detect color region(s) in theoriginal digital image and remove the detected edges in step 100 in thedetected color region(s) from the original digital image to get rid ofthe unwanted edges because the text 23 is in neutral color (with nochrominance). Lastly, generate the non-graphical digital image from theregions surrounded by the remaining detected edges. The remaining edgesare the edges of the text 23 (non-graphical regions) in the printed page20. Please note that the result of each step is stored in a storagedevice of an executing system such as a CPU or a microcontroller, whichis capable of performing the calculations and operations required ineach step in FIG. 4; and moreover, provided that the result issubstantially the same, the steps are not required to be executed in theexact order shown in FIG. 4, they can be executed simultaneously if thesystem has sufficient resources.

Please refer to FIG. 5. FIG. 5 is a more detailed flow chart of step 100in FIG. 4. The edge detection method in step 100 can be further detailedin the following steps:

Step 101: detect first regions with luminance higher than an upperthreshold.

Step 103: detect second regions with luminance lower than a lowerthreshold; the lower threshold is lower than the upper threshold.

Step 105: dilate the first regions according to a predetermined rule togenerate a first digital image.

Step 107: dilate the second regions according to the predetermined ruleto generate a second digital image.

Step 109: generate a third digital image by intersecting dilated firstand second regions.

First, detect first regions with luminance higher than an upperthreshold and second regions with luminance lower than a lowerthreshold, as shown in FIG. 6, instead of comparing the luminance of allregions, which the conventional art does and requires more resources andtime. FIG. 6 is the drawing of the detected result according to steps101 and 103 in FIG. 5. FIG. 7 is the first regions detected in FIG. 3.FIG. 8 is the second regions detected in FIG. 3. Secondly, dilate thefirst and second regions respectively by one to several pixels togenerate a first digital image and a second digital image. Please referto FIG. 9 and FIG. 10. FIG. 9 is a first digital image including thedilation result of FIG. 7; and FIG. 10 is a second digital imageincluding the dilation result of FIG. 8. The extent of dilation dependson the characteristics of the original digital image in the printed page20, such as the resolution or clearness of the original digital image.Lastly, generate a third digital image by intersecting dilated first andsecond regions and keep the third image in the storage device of theexecuting system. FIG. 11 is a third digital image including theintersection edges of FIG. 9 and FIG. 10. FIG. 12 is the intersectionedges according to FIG. 6. Please note that provided that the result issubstantially the same, the steps are not required to be executed in theexact order shown in FIG. 5.

Please refer to FIG. 13-24 together. FIG. 13-20 are the normalizedspectrum images of uniform patches of monochrome photos of 200 lpi. FIG.21-24 are the spectrum images of multipass-color photos (with moiréstructure) of 200 lpi. From FIG. 13-24, we can see the screen linesformed by screen dots of different colors generate different anglescorresponding to the center dot (the moiré structure) on the spectrumimages, but have the same distance from the center dot (DC value); it isbecause the “lpi” for different colors are exactly the same.

After edge detection, as shown in step 200 in FIG. 4, the presentinvention raises two embodiments for performing the screen dot detectionmethod to detect the region of the photo region 27 in the printed page20. The first embodiment utilizes Discrete Fourier Transform to analyzethe number of lines per inch within a coordinate region of apredetermined size in the original digital image of the printed page 20.The size of the coordinate region can be chosen according to thecharacteristics of the original digital image of the printed page 20,such as the resolution or clearness of the original digital image.Please refer to FIG. 25. FIG. 25 is the flow chart of utilizing DiscreteFourier Transform to complete the screen dot detection according to thefirst embodiment of the present invention. The steps of FIG. 25 can beinterpreted in details as follows:

Step 210: choose a coordinate region in the original digital image.

Step 212: analyze a spectrum (frequency of the screen lines) of thecoordinate region with Discrete Fourier Transform.

Step 214: compare the specified frequencies of coordinate region to aplurality of frequencies set up in the storage device of the executingsystem in advance. If the analysis result matches one of the built-infrequencies, then go to step 216; if not, go to step 218.

Step 216: set the coordinate region as a screen block and generate afourth digital image (or update the fourth digital image, if it has beengenerated) including the screen block.

Step 218: determine if there is at least one other coordinate region inthe original digital image to be detected. If so, go to step 210, ifnot, go to step 219.

Step 219: end.

First, choose a coordinate region in the original digital imagegenerated from the printed page 20, and analyze the spectrum of thecoordinate region with Discrete Fourier Transform. Then compare theanalysis result to a plurality of frequencies stored in the storagedevice of the executing system in advance to determine whether thecoordinate region is a screen block or not. If the spectrum exists aconstant frequency in the coordinate region, and the constant frequencymatches one of the built-in frequencies, then set the coordinate regionas a screen block and generate a fourth digital image (or update thefourth digital image, if it has been generated) including the screenblock. Moreover, the fourth digital image will be saved into the storagedevice of the executing system. The coordinate region is chosen from topto bottom, and from left to right in the original digital image untilall the coordinate regions in the original digital image have been gonethrough once. The frequencies of uniform patches under various lpi(lines per inch) set up in the storage device in advance are the numbersof lines per inch commonly used in printing, such as 200 lpi, 150 lpi,or 85 lpi. A screen block means that each dot in the screen blockbelongs to screen dot. The equation of Discrete Fourier Transform usedin the first embodiment is listed below:

${F\left\lbrack {u,v} \right\rbrack} = {\frac{1}{MN}{\sum\limits_{x = 0}^{M - 1}{\sum\limits_{y = 0}^{N - 1}{{f\left\lbrack {x,y} \right\rbrack}{\mathbb{e}}^{\lbrack{{- j}\; 2{\pi{({\frac{ux}{M} + \frac{vy}{N}})}}}\rbrack}}}}}$

wherein f [x,y] is the coordinate (x,y) of a pixel in the digital imageof the printed page 20;

F[u,v] is the discrete Fourier transform of f [x,y];

M, N is the size of the analysis coordinate region.

Please refer to FIG. 26. FIG. 26 is the fourth digital image of theresult of screen dot detection derived from Discrete Fourier Transformaccording to FIG. 3. Please note that the method of the presentinvention is only recommended to be applied in a photo region withsingle lpi setting, but not recommended to be applied in a photo withvarious lpi.

After Fourier Transform, a lot of screen blocks can be detected.However, since a photo region must be a complete region in the printedpage 20, next, connect the detected and segmented screen blocks into acomplete region in order to find the region of the photo region 27. Themethod of connecting the detected and segmented screen blocks into acomplete region is called a peak-block-connection step. Please refer toFIG. 27. FIG. 27 is the detailed flowchart of the peak-block-connectionstep. A peak block is defined as a set of m*n blocks in the digitalimage. The steps of FIG. 27 can be further detailed as follows:

Step 220: find two peak blocks A, B of m*n blocks respectively on thesame horizontal line in a region of m*h blocks in the fourth digitalimage.

Step 222: detect line patterns formed by screen blocks in the peak blockA.

Step 224: detect line patterns formed by screen blocks in the peak blockB.

Step 226: compare the line patterns formed by screen blocks found inpeak blocks A and B, and if the line patterns in the peak blocks A and Bmatch at least a same predetermined line pattern stored in the storagedevice of the executing system, then go to step 228; if not, go to step230.

Step 228: set all blocks in a region C of x*y blocks connecting bothcenter blocks of the peak blocks A and B as screen blocks and generate afifth digital image (or update the fifth digital image, if it has beengenerated) including the screen blocks in the region C.

Step 230: determine if there is at least one other peak block in thefourth digital image to be detected. If so, go to step 220, if not, goto step 232.

Step 232: end.

According to the above-mentioned steps, first, define the region of m*nblocks as a peak block. Then compare the distribution of line patternsof the screen blocks found in two peak blocks A and B, located on a samehorizontal line in the fourth digital image within a range of m*hblocks, wherein n<h. If the distributions of line patterns of the screenblocks in the peak blocks A and B match at least one similarpredetermined line pattern stored in the storage device of the executingsystem beforehand, set all blocks in a region C of x*y blocks,connecting both center blocks of the peak blocks A and B, as screenblocks, and generate a fifth digital image (or update the fifth digitalimage, if it has been generated) including the screen blocks in theregion C. Wherein m, n, h, x, y are arbitrary positive integers chosenaccording to the characteristics of the image, such as the size,clearness, or resolution. The region of m*h blocks is chosen from top tobottom, and from left to right in the fourth digital image, until thefourth digital image has been gone through once. Please refer to FIG.28. FIG. 28 is a drawing of predetermined line patterns stored in thestorage device of the executing system. Please note that vertical blocksx in a column of the region C (blocks x*y) must be smaller than verticalblocks m in a column of the peak block (blocks m*n) by at least oneblock at the top and one block at the bottom respectively. Moreover, thefifth digital image will be saved into the storage device of theexecuting system. Please refer to FIG. 29 and FIG. 30. FIG. 29 includesdrawings of the peak blocks A, B and the region C, and drawings of linepatterns in peak blocks A and B, and the set result in the region C.FIG. 30 is the fifth digital image of the result derived from thepeak-block-connection step according to FIG. 3. Please note thatprovided that the result is substantially the same, the steps are notrequired to be executed in the exact order shown in FIG. 27.

After performing the peak-block-connection step to find a completeregion of the photo, a next step is removing the blocks chosenincorrectly. The theory of this step is similar to Dilation and Erosion,determining whether a block within a predetermined region of blocks is ascreen block according to an attribute of surrounding blocks of theblock. Please refer to FIG. 31 and FIG. 32. FIG. 31 and FIG. 32 are thedetailed flowcharts of removing the blocks chosen incorrectly. The stepsof FIG. 31 and FIG. 32 can be further detailed as follows:

Step 240: set n1=1, wherein n1 is a positive integer.

Step 242: choose a left-most and top-most block in the fifth digitalimage as a target block.

Step 244: determine if the number of surrounding blocks of the targetblock within a region B1 of p*q blocks include screen blocks in thefifth digital image equal to or greater than a predetermined threshold,wherein the target block is a center block within the region B1. If so,go to step 254, if not, go to step 256.

Step 246: set n1=n1+1.

Step 248: determine if surrounding blocks of a target block within aregion A1 of j*k blocks in the sixth digital image include more than onescreen block determined in steps before n1 is incremented in step 246.If so, go to step 250, if not, go to step 252.

Step 250: determine if surrounding blocks of the target block within aregion B2 of p*q blocks include at least one screen block in the fifthdigital image, wherein the target block is a center block within theregion B2. If so, go to step 254, if not, go to step 256.

Step 252: determine if surrounding blocks of the target block within aregion B2 of p*q blocks include screen blocks equal to or greater thanthe predetermined threshold in the fifth digital image, wherein thetarget block is a center block within the region B2. If so, go to step254, if not, go to step 256.

Step 254: set the target block as a screen block, and generate a sixthdigital image (or update the sixth digital image, if it has beengenerated) including the screen block. Go to step 257.

Step 256: set the target block as a non-screen block, and generate asixth digital image (or update the sixth digital image, if it has beengenerated) including the non-screen block. Go to step 257.

Step 257: determine if there is at least one other block in the sixthdigital image to be detected. If so, go to step 246, if not, go to step258.

Step 258: end.

The step of removing the blocks chosen incorrectly is performed bysetting a left-most and top-most target block in the fifth digital imageas a screen block or a non-screen block and generating a sixth digitalimage according to a number of screen blocks besides the left-most andtop-most target block within the region B1 of p*q blocks in the fifthdigital image, wherein the left-most and top-most target block is acenter block of the region B1; and setting a target block within theregion A1 of j*k blocks in the sixth digital image as a screen block ora non-screen block and updating the sixth digital image according to anumber of screen blocks besides the target block within the region A1 ofj*k blocks in the sixth digital image, and a number of screen blocksbesides the target block within the region B2 of p*q blocks in the fifthdigital image, wherein the target block is a center block of the regionB2 of p*q blocks, and j, k, p, q are arbitrary positive integers chosenaccording to the characteristics of the image, such as the size,clearness, or resolution. The target blocks besides the left-most andtop-most target block are chosen from top to bottom, and from left toright in the sixth digital image until the sixth digital image has beengone through once, and the left-most and top-most target block is chosenin the fifth digital image. Determining whether the target block is ascreen block or a non-screen block can be categorized into severalconditions:

1. If the target block is the left-most and top-most target block chosenin the fifth digital image:

Condition I: If the number of surrounding blocks of the target blockwithin the region B1 in the fifth digital image include screen blocksequal to or greater than a predetermined threshold, determine that thetarget block is a screen block and generate a sixth digital imageincluding the target block.

Condition II: If the number of surrounding blocks of the target blockwithin the region B1 in the fifth digital image include screen blocksless than a predetermined threshold, determine that the target block isnot a screen block and generate a sixth digital image including thetarget block.

2. If the target block is not the left-most and top-most block and ischosen in the sixth digital image:

Condition III: If less than two surrounding blocks of the target blockwithin a region A are screen blocks in the sixth digital image, and morethan a predetermined threshold of the screen blocks were found in thefifth digital image within a region B2, determine the target block is ascreen block and updating the sixth digital image; wherein the targetblock is a center block of the region B2.

Condition IV: If more than one surrounding block of the target blockwithin a region A is a screen block in the sixth digital image, andequal to or greater than one screen block was found in the fifth digitalimage within a region B2, determine the target block is a screen blockand update the sixth digital image; wherein the target block is a centerblock of the region B2.

Condition V: If less than two surrounding blocks of the target blockwithin a region A are screen blocks in the sixth digital image, and lessthan a predetermined threshold of the screen blocks were found in thefifth digital image within a region B2, determine that the target blockis not a screen block and update the sixth digital image; wherein thetarget block is a center block of the region B2.

Condition VI: If more than one surrounding block of the target blockwithin a region A is a screen block in the sixth digital image, and lessthan two screen blocks were found in the fifth digital image within aregion B2, determine that the target block is not a screen block andupdate the sixth digital image; wherein the target block is a centerblock of the region B2.

Please refer to FIG. 33, FIG. 34, and FIG. 35 in all. FIG. 33 is adrawing of Condition III and FIG. 34 is a drawing of Condition IVaccording to the present invention. FIG. 35 is a sixth digital image ofthe result of removing the blocks chosen incorrectly according to FIG.3. Please note that the region A of j*k blocks must be smaller than theregion B1 of p*q blocks, and the target block can't be the left-most andtop-most block within the region A. That is the target block in theregion A should be chosen at least from the second column and second rowat the beginning of this step. Provided that the result is substantiallythe same, the steps are not required to be executed in the exact ordershown in FIG. 31 and FIG. 32.

The last calibration step of screen dot detection is expanding thedetected region of the photo. Sometimes after all the aforementionedsteps, the detected region can't completely cover the photo region,especially the edges of the photo region 27. Therefore, expand thedetected region derived from the aforementioned steps in order to coverthe edges of the photo region 27 is the last step of the screen dotdetection procedure according to the present invention. Please refer toFIG. 36. FIG. 36 is the detailed flowchart of expanding the detectedregion of the photo according to the first embodiment of the presentinvention. The steps of FIG. 36 can be further detailed as follows:

Step 260: choose a block in the sixth image derived from theaforementioned steps.

Step 262: detect whether there is at least one screen block within aneighborhood (r*s blocks) of the block. If so, go to step 264, if not,go to step 266.

Step 264: set the block as a screen block and generate a seventh digitalimage (or update the seventh digital image, if it has been generated)including the block, then go to step 266.

Step 266: determine if there is at least one other block to be detectedin the photo region in the seventh digital image. If so, go to step 260,if not, go to step 268.

Step 268: end.

Expanding the detected region of the photo derived from theaforementioned steps is also based on the attributes of neighboringblocks of a block. If at least one screen block is detected in theneighborhood (r*s blocks) of the block, set the block as a screen blockand generate a seventh digital image (or update the seventh digitalimage, if it has been generated) including the block. The block ischosen from top to bottom, and from left to right in the sixth digitalimage until the whole sixth digital image has been gone through once.Please refer to FIG. 37 and FIG. 38. FIG. 37 includes a drawing of ablock in a detected region including a screen block, and a drawing ofoutputting the block as a screen block. FIG. 38 is a seventh digitalimage of the result of expanding the detected region of the photoaccording to FIG. 3. Please note that in this last calibration step, itis not necessary for the block to be a center block in the neighborhoodof r*s blocks, wherein r, s are arbitrary positive integers chosenaccording to the characteristics of the image, such as the size,clearness, or resolution. Provided that the result is substantially thesame, the steps are not required to be executed in the exact order shownin FIG. 36.

The above-mentioned is the method of screen dot detection utilizingDiscrete Fourier Transform, the present invention further releases asecond embodiment utilizing a peak/valley detection method to replaceDiscrete Fourier Transform. Please refer to FIG. 39. FIG. 39 is thedetailed flowchart of peak/valley detection according to the secondembodiment of the present invention. The steps of FIG. 39 can be furtherdetailed as follows:

Step 280: choose a region D of e*f pixels, and find a center pixel ofthe region D in the original digital image.

Step 282: choose neighboring pixels of the center pixel within theregion D according to a predetermined rule (or an algorithm) stored inthe storage device of the executing system.

Step 284: compare luminance of the center pixel with all neighboringpixels in the region D. If the luminance of the center pixel is greaterthan luminance of all the neighboring pixels in the region D by at leasta first luminance threshold, then go to step 286, if not, then go tostep 285.

Step 285: determine if the luminance of the center pixel is less thanthe luminance of all the neighboring pixels in the region D by at leasta second luminance threshold, then go to step 286, if not, then go tostep 288.

Step 286: set the center pixel in the region D as a screen dot andgenerate an eighth digital image (or update the eighth digital image, ifit has been generated) including the center pixel.

Step 288: determine if there is at least one other block in the originaldigital image to be detected. If so, go to step 280, if not, go to step289.

Step 289: end.

The step is performed by setting a center pixel of a region D of e*fpixels as a screen dot according to luminance differences between thecenter pixel and neighboring pixels within the region D of e*f pixelschosen according to a predetermined rule stored in the storage device ofthe executing system in advance. First, choose a detected region D ofe*f pixels in the original digital image, wherein e, f are arbitrarypositive integers chosen according to the characteristics of the image,such as the size, or clearness. The detected region D is chosen from topto bottom, and from left to right in the original digital image untilthe whole original image has been gone through once. Compare luminanceof the center pixel in the region D with luminance of the neighboringpixels chosen according to a predetermined rule or an algorithm storedin the storage device of the executing system. The rule or the algorithmis determined according to the number of lines per inch in the photoregion 27. The number of lines per inch in the photo region 27 iscompared with several numbers of lines per inch commonly-used inprinting, and stored in the storage device of the executing system inadvance. If the number of lines per inch is less, it means that thescreen dots are bigger, then the neighboring pixels should be chosenfurther from the center pixel, please refer to FIG. 40. FIG. 40 is anexemplary drawing of choosing neighboring pixels when the number oflines per inch is less. On the contrary, if the number of lines per inchis greater, it means the screen dots are more condensed, then theneighboring pixels should be chosen closer to the center pixel, pleaserefer to FIG. 41. FIG. 41 is an exemplary drawing of choosingneighboring pixels when the number of lines per inch is greater.Subsequently, according to the compared result, if the luminance of thecenter pixel is more than the luminance of the neighboring pixels withinthe region D by equal to or more than a predetermined first luminancethreshold, then determine the center pixel in the region D is a screendot and generate an eighth digital image (or update the eighth digitalimage, if it has been generated) including the center pixel. This is thepeak detection. If the luminance of the center pixel is less than theluminance of the neighboring pixels within the region D by equal to orless than a predetermined second luminance threshold, then determine thecenter pixel in the region D is a screen dot and generate an eighthdigital image (or update the eighth digital image, if it has beengenerated) including the center pixel. This is the valley detection.Please note that provided that the result is substantially the same, thesteps are not required to be executed in the exact order shown in FIG.39.

After determining screen dots in the eighth digital image, integrate allthe detected, spotted screen dots into a complete region. First, definea screen block is a block in which each dot is a screen dot. Pleaserefer to FIG. 42. FIG. 42 is the detailed flowchart of integrating thedetected screen dots according to the second embodiment of the presentinvention. The steps of FIG. 42 can be further detailed as follows:

Step 290: determine a block of c*d pixels on the eighth digital image.

Step 292: detect whether there is a screen dot in the block or not. Ifso, go to step 294, if not, go to step 296.

Step 294: set the block as a screen block and generate a ninth digitalimage (or update the ninth digital image, if it has been generated)including the block.

Step 296: determine if there is at least one other block in the eighthdigital image to be detected. If so, go to step 290, if not, go to step298.

Step 298: end.

The step of integrating the detected screen dots can be performed bydetecting whether there is a screen dot in a block of c*d pixels,wherein c, d are arbitrary positive integers chosen according to thecharacteristics of the image, such as the size, clearness, orresolution. If the block includes at least one screen dot, set the blockas a screen block (set all the remaining pixels in the block as screendots), and generate a ninth digital image (or update the ninth digitalimage, if it has been generated) including the block. The block ischosen from top to bottom, and from left to right in the eighth digitalimage until the whole eighth digital image has been gone through once.Please refer to FIG. 43. FIG. 43 is a drawing of the procedures ofintegrating the detected screen dots according to the second embodimentof the present invention. Please note that provided that the result issubstantially the same, the steps are not required to be executed in theexact order shown in FIG. 42.

After the steps of peak/valley detection and integrating the detectedscreen dots, according to the second embodiment, the following stepsincluded in the screen dot detection method are peak block connection,removing the blocks chosen incorrectly, and expanding the detectedregion of the photo, similar to the steps of the first embodiment.Therefore, the description is omitted here for the sake of brevity.

After the screen dot detection, remove the photo region detected by thescreen dot detection from the third digital image generated from theedge detection step. Please refer to FIG. 44, FIG. 45, and FIG. 46 inall. FIG. 44 is a drawing of the result of edge detection according toFIG. 3. FIG. 45 is a drawing of the result of screen dot detectionaccording to FIG. 3, and FIG. 46 is a drawing of the result of removingthe photo region detected by the screen dot detection from the thirddigital image generated from the edge detection step according to FIG.44 and FIG. 45.

After removing the photo region detected by the screen dot detectionfrom the third digital image, the process goes to the step of detectingcolor regions in the original digital image and removing the colorregions from the third digital image to generate the non-graphic digitalimage. Because the color region is defined as a graph in the presentinvention, it should be removed so as to get the wanted region of text.Detecting the color region is performed through detecting thechrominance of pixels. As mentioned before, the present inventiontransforms RGB of the pixels into YCaCb to separate data of luminanceand chrominance. In YCaCb information, the luminance of each pixel isrepresented by data of Y, and the chrominance of each pixel isrepresented by data of CaCb. Therefore, it's easy to detect a colorpixel through CaCb data. Please refer to FIG. 47, FIG. 48, and FIG. 49.FIG. 47 is a drawing of the chrominance distribution according to CaCbdata. The center white region of FIG. 47 is the region of neutral color.FIG. 48 is a drawing of the detected edges including text and colorlines after performing step 100, 200, 300 in FIG. 5 according to FIG. 3.FIG. 49 is the non-graphical digital image generated after removing thedetected color regions from the third digital image according to FIG. 3and FIG. 48.

At last, the regions surrounded by the remaining detected edges can bedetermined as non-graphical regions (text). Therefore, generate thenon-graphical digital image according to the non-graphical regions.Subsequently the non-graphical digital image (text) can be enhanced orcopied separately in order to represent a desired effect, instead ofperforming the processing on the whole digital image of the printedpage, such as enhancing or copying, which may cause unexpected defectsand unwanted results in exhibition of the whole digital image.

To sum up, the present invention also utilizes a high and a lowluminance threshold to decrease the calculations and operations of theedge detection so as to save the cost and resources of the edgedetection. Moreover, a Discrete Fourier Transform is newly applied tothe screen dot detection step by the present invention. And besidesDiscrete Fourier Transform, the present invention also releases severalsteps including peak/valley detection, integrating the detected screendots, peak block connection, removing the blocks chosen incorrectly, andexpanding the detected region of the photo to complete the screen dotdetection, which is also a new arrangement and invention in this field.

Those skilled in the art will readily observe that numerousmodifications and alterations of the device and method may be made whileretaining the teachings of the invention.

1. A method for generating a non-graphical digital image from anoriginal digital image, comprising: detecting first areas of theoriginal digital image whose luminance values are above a firstpredetermined luminance threshold; detecting second areas of theoriginal digital image whose luminance values are below a secondpredetermined luminance threshold, the second predetermined luminancethreshold being smaller than the first predetermined luminancethreshold; dilating the first areas to generate a first digital image;dilating the second areas to generate a second digital image; generatinga third digital image including edges from dilated first and secondareas; performing screen dot detection in the original digital image fordetecting photo regions; detecting color regions in the original digitalimage; and removing the photo regions and the color regions from thethird digital image to generate the non-graphical digital image.
 2. Themethod of claim 1 wherein detecting the color regions in the originaldigital image comprises detecting the color regions in the originaldigital image through chrominance of pixels.
 3. The method of claim 1wherein generating the third digital image including the edges from thedilated first and second areas comprises intersecting the dilated firstand second areas to generate the edges.